Optimizing the brain